<template>
	<view>
		<view class="navbar"  style="padding: 20rpx;height: 180rpx;background-color: #fa3534;">
			<view class="title" style="color: #fff;font-size: 45rpx;text-align: center;font-weight: bold;">智慧建党</view>
			<view class="search" style="width: 95%;height: 64rpx;border-radius: 50rpx;border: 2rpx solid #dd6161;
			background-color: #f2f2f2;margin: 20rpx auto;display: flex;flex-direction: row;justify-content: start;
			align-items: center;position: relative;flex-shrink: 0;">
				<u-icon name="search" style="margin-left: 20rpx;"></u-icon>
				<input type="text" placeholder="请输入关键字" v-model="value" style="margin-left: 20rpx;">
				<button class="bu" style="width: 120rpx;height: 95%;background-color: #fa3534;border-radius: 50rpx;
				position: absolute;right: 1rpx;top: 1rpx;" @click="submit">搜索</button>
			</view>
		</view>
		<scroll-view scroll-y="true" class="main">
			<view class="content">
				<view class="swiper" style="padding: 20rpx;background-color: #fff;">
					<u-swiper :list="swiperList" height="300" @click="to"></u-swiper>
				</view>
				<view class="cate">
					<navigator class="cate-item center" url="/pages/china-trends/china-trends">
						<image src="/static/icon2/set-1.png" mode=""></image>
						<text>党建动态</text>
					</navigator>
					<navigator class="cate-item center" url="/pages/china-study/china-study">
						<image src="/static/icon2/set-2.png" mode=""></image>
						<text>党员学习</text>
					</navigator>
					<navigator class="cate-item center" url="/pages/organization/organization">
						<image src="/static/icon2/set-3.png" mode=""></image>
						<text>组织活动</text>
					</navigator>
					<navigator class="cate-item center" url="/pages/advice/advice">
						<image src="/static/icon2/set-4.png" mode=""></image>
						<text>建言献策</text>
					</navigator>
					<navigator class="cate-item center" url="/pages/photo/photo">
						<image src="/static/icon2/set-5.png" mode=""></image>
						<text>随手拍</text>
					</navigator>
				</view>
				<view class="news" style="margin-top: 20rpx;">
					<u-sticky offset-top="90">
						<u-tabs :list="tabList" :is-scroll="false" :current="tabCurrent" @change="tabChange" active-color="#fa3534"></u-tabs>
					</u-sticky>
					<view class="news-list" style="padding: 20rpx;background-color: #fff;">
						<view class="news-item" style="display: flex;flex-direction: row;
						justify-content: space-between;padding: 20rpx 0;border-top: 2rpx solid #e4e7ed;" v-for="item in 5">
							<view class="left" style="width: 450rpx;">
								<view class="top" style="height: 168rpx;">
									<text class="line" style="font-weight: bold;font-size: 32rpx;">
										永远跟党走{{tabCurrent + 1}}
										</text>
									<text class="line" style="font-size: 26rpx;">
										永远更党走，风景新政策，永远更党走，风景新政策，永远更党走，风景新政策，永远更党走，风景新政策
										</text>
								</view>
								<view class="bottom" style="display: flex;flex-direction: row;font-size: 22rpx;
								color: #666;">
									<text>99 阅读</text>
									<text style="margin-left: 20rpx;">2023-2-21</text>
								</view>
							</view>
							<view class="right center">
								<navigator url="/pages/china-detail/china-detail">
									<image src="/static/DangJian1.jpg.jpg" mode="" style="width: 250rpx;height: 200rpx;"></image>
								</navigator>
							</view>
						</view>
						<u-divider>没有更多了</u-divider>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				swiperList: [
					{
						image: '../../static/DangJian1.jpg.jpg'
					},
					{
						image: '../../static/DangYuanHuoDong1.jpg.jpg'
					},
					{
						image: '../../static/u=604788707,102911010&fm=26&fmt=auto&gp=0.jpg'
					}
				],
				tabList: [
					{
						name: '最新动态'
					},
					{
						name: '党之廉政'
					},
					{
						name: '党之风采'
					}
				],
				tabCurrent: 0
			};
		},
		onLoad() {
		},
		methods:{
			tabChange(index){
				this.tabCurrent = index
			},
			to(){
				uni.navigateTo({
					url:'/pages/china-detail/china-detail'
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	height: 100%;
	view{
		height: 100%;
		display: flex;
		flex-direction: column;
		.main{
			flex: 1;
			overflow: hidden;
			.content{
				height: fit-content;
				background-color: #f7f7f7;
				.cate{
					padding: 20rpx;
					display: flex;
					flex-wrap: wrap;
					flex-direction: row;
					justify-content: space-between;
					background-color: #fff;
					margin-top: 20rpx;
					.cate-item{
						width: 120rpx;
						height: fit-content;
						display: flex;
						flex-direction: column;
						image{
							width: 100rpx;
							height: 100rpx;
							border-radius: 20rpx;
						}
						text{
							text-align: center;
							width: 120rpx;
							color: #666;
							margin-top: 10rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}
						.icon{
							width: 100rpx;
							height: 100rpx;
							border-radius: 50%;
							border: 4rpx solid #2979ff;
							color: #2979ff;
						}
					}
				}
			}
		}
	}
}
</style>
